package com.simple.microservices.commons.annotation;


import com.simple.microservices.commons.validator.CollectionValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;


/**
 * 此注解可对集合类型参数进行校验,目前仅支持校验集合是否不为空
 * 可在 CollectionValidator 类中自行拓展
 */
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = {CollectionValidator.class})
@Documented
public @interface CollectionValid {

    String message() default "";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    boolean notEmpty() default true;


}
